package cn.iocoder.yudao.module.contract.dal.mysql.material;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.contract.dal.dataobject.material.MaterialDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.contract.controller.admin.material.vo.*;

/**
 * 物料档案 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface MaterialMapper extends BaseMapperX<MaterialDO> {

    default PageResult<MaterialDO> selectPage(MaterialPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MaterialDO>()
                .likeIfPresent(MaterialDO::getMatnr, reqVO.getMatnr())
                .likeIfPresent(MaterialDO::getZzcpgg, reqVO.getZzcpgg())
                .likeIfPresent(MaterialDO::getBismt, reqVO.getBismt())
                .orderByDesc(MaterialDO::getId));
    }

}